


#include "myHead.h"
#include "game.h"
#include "SierpinskinGame.h"


bool initGL()
{
	bool ret = false;
	ret = Game::getGame()->initGl();
	return ret;
}

void render()
{

	Game::getGame()->render();
	
}
int main(int argc, char* args[])
{
	//Initialize FreeGLUT
	glutInit(&argc, args);

	//Create OpenGL 2.1 context
	//glutInitContextVersion(2, 1);

	//Create Double Buffered Window
//	glutInitDisplayMode(GLUT_DOUBLE);
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutInitWindowSize(640, 480);
	glutCreateWindow("OpenGL");
	glutInitWindowPosition(1000, 100);
	//glutDestroyWindow(onDestoryWin);
	
	Game game; //the function ~Game() don't execute when i close the window ,why???
	
	//SimpleTool tool;
	initGL();
	//Set rendering function
	glutDisplayFunc(render);

	

	//Start GLUT main loop
	glutMainLoop();
	
	return 0;
}

